package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsGoodsAttributeMapper;
import com.qf.mapper.DtsGoodsSpecificationMapper;
import com.qf.mapper.DtsStorageMapper;
import com.qf.pojo.DtsGoodsSpecification;
import com.qf.pojo.DtsStorage;
import com.qf.service.SpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SpecificationServiceImpl implements SpecificationService {
    @Autowired
    DtsGoodsSpecificationMapper dtsStorageMapper;

    @Override
    public List<DtsGoodsSpecification> findAttributesByGoodsId(Integer id) {
        LambdaQueryWrapper<DtsGoodsSpecification> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsGoodsSpecification::getGoodsId, id);
        wrapper.eq(DtsGoodsSpecification::getDeleted, false);
        List<DtsGoodsSpecification> selectList = dtsStorageMapper.selectList(wrapper);

        return selectList;
    }
}
